home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / src / bin / util / geomstuff < prev    next >
Text File  |  1992-03-09  |  734b  |  37 lines

  1. #! /bin/sh
  2.  
  3. pipedir=/tmp/geomview
  4.  
  5. case "$1" in
  6.   -M) pipedir=$2; shift 2 ;;
  7.   -M*) pipedir="`expr "$1" : "-M\(.*\)"`"; shift ;;
  8.   -*) shift $# ;;
  9. esac
  10.  
  11. if [ $# = 0 ]; then
  12.     echo "Usage: $0  [-Mpipedirectory]  symbolname   [ OOGLfilename ]
  13. Write geometric data to the given symbol.  Reads from stdin if no file given.
  14. In typical use, a program pipes data to 'geomstuff somename',
  15. while you run    geomview -M somename     to see the result.
  16. Pipes created by default in $pipedir." >&2
  17.     exit 1
  18. fi
  19.     
  20.  
  21. pipe=$pipedir/$1
  22. shift
  23.  
  24. if [ ! -d $pipedir ] ; then
  25.   mkdir $pipedir
  26.   chmod a+w $pipedir
  27. fi
  28. if [ ! -p $pipe ] ; then
  29.   /bin/rm -f $pipe
  30.   /etc/mknod $pipe p
  31. fi
  32.  
  33. cat $@ > $pipe
  34.  
  35. #echo Finished stuffing to $pipe, status $? >&2
  36.  
  37.